//
//  Coordinator.swift
//  CitySearch
//
//  Created by guotonglin on 2020/6/2.
//  Copyright © 2020 guotonglin. All rights reserved.
//

import Foundation


protocol Coordinator: class {
    
    var childCoordinator: [Coordinator] { get set}
    
    func start()
}

extension Coordinator {
    
    func add(coordinator: Coordinator) -> Void {
        childCoordinator.append(coordinator)
    }
    
    func remove(coordinator: Coordinator) -> Void {
        childCoordinator = childCoordinator.filter({ $0 !== coordinator})
    }
}
